package com.example.accessingdatajpa.service;

import com.example.accessingdatajpa.pojo.Goods;
import com.example.accessingdatajpa.response.RestResponse;

import javax.transaction.Transactional;
import java.util.List;

public interface IGoodsService {
    //find all goods
    @Transactional
    RestResponse<List<Goods>> queryAllGoods();

    //find goods by categoryId
    @Transactional
    RestResponse<List<Goods>> queryGoodsByCategoryId(Long categoryId);

    //fuzzy search goods by goods title
    @Transactional
    RestResponse<List<Goods>> queryGoodsByGoodsName(String goodsTitle);

    //find hot goods
    @Transactional
    RestResponse<List<Goods>> queryHotGoods();

    //find new goods
    @Transactional
    RestResponse<List<Goods>> queryNewGoods();

    //find other goods
    @Transactional
    RestResponse<List<Goods>> queryOtherGoods(Long categoryId);

    //add new goods
    @Transactional
    RestResponse<String> addNewGoods(Goods goods);
}
